#pragma once


#include "Type.h"
#include "DecoratedType.h"

class CFunctionTypeGeneralized;

//type of TScriptDelegate<T,Args...>
class WHENGINE_API CScriptDelegateType : public CType
{
public:
    CScriptDelegateType();

    static CScriptDelegateType* GetStaticType();
    
    static CString CreateTypeName(const CString& ReturnType, const TVector<CString>& ParamTypes);
    static STypeID CreateID(
        const SDecoratedType & ReturnType
        , const TVector< SDecoratedType > &ParamTypes
        );
    static STypeID CreateID(
        const STypeID & ReturnType
        , const TVector< STypeID > &ParamTypes
        );


};

class WHENGINE_API CScriptDelegateGenerialized : public CType
{
public:
    CScriptDelegateGenerialized(
        CFunctionTypeGeneralized* InFunctionType
        ,ETypeFlags InExtraFlags=ETypeFlags::None
        );

    void SetTypeArguments(CFunctionTypeGeneralized* InFunctionType);

    SDecoratedType GetReturnType() const;
    TVector<SDecoratedType> GetParameterTypes() const;
    CFunctionTypeGeneralized* GetFunctionType() const;

    int64_t GetBindingNum(const void* InInstance) const;

    // static CString CreateTypeName(CFunctionTypeGeneralized* InFunctionType);
    // static CString CreateTypeName(const CString & ReturnType, const TVector<CString>& ParamTypes);

protected:
    CFunctionTypeGeneralized* FunctionType=nullptr;
    
    

};

